package cn.cpf.app.gobang.modal;

import lombok.NonNull;

/**
 * <b>Description : </b> 棋子工厂
 * <p>
 * <b>created in </b> 2017/10/24
 * </p>
 *
 * @author CPF
 **/
public class PieceFactory {

    private PieceFactory(){}

	public static Piece getPieceByPart(@NonNull Part part, Place place) {
		if (Part.WHITE.equals(part)) {
			return getWhitePiece(place);
		} else {
			return getBlackPiece(place);
		}
	}

	public static Piece getWhitePiece(Place place) {
		return new Piece(place, Part.WHITE, GobangImage.WHITE.imageIcon);
	}

	public static Piece getBlackPiece(Place place) {
		return new Piece(place, Part.BLACK, GobangImage.BLACK.imageIcon);
	}

}
